<?php
function outputRe($pattern, $string) {
    if (preg_match_all($pattern, $string, $matched)) {
        echo '正则表达式:', htmlentities($pattern), '和字符串：', htmlentities($string), '匹配成功，匹配的字符串是：', "<br />";
        echo "<pre>";
        var_dump($matched);
        echo '</pre>';
    } else {
        echo "<p>", '没找到匹配字符', "</p>";
    }
}

// $pattern = '/[a-z,0-9]/';
$pattern = '/[\x80-\xff]{6}/';
// $pattern = '/d+/';
$pattern = '/^[\x80-\xff]{3,}$/';

$string = 'ok含ddd汉字ssss西北民族ddd';
$string = '纯粹由d中文字2符组成·（）【】';
outputRe($pattern, $string);

?>
